package com.iflytek.day12._03_override;

class Person2 {
  private String name;
  private int age;

  public Person2() {
    System.out.println("父类无参");
  }

}

class Student2 extends Person2 {
  private double score;

  public Student2() {
    super(); // 调用父类无参,默认就存在，可以不写，必须再第一行
    System.out.println("子类无参");
  }

  public Student2(double score) {
    // super();  // 调用父类无参,默认就存在，可以不写，必须再第一行
    this.score = score;
    System.out.println("子类有参");
  }

}

public class Demo02 {
  public static void main(String[] args) {
    Student2 s1 = new Student2();
    System.out.println("----------");
    Student2 s2 = new Student2(99.9);
  }
}